﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Windows.Design.Metadata;
using DraggableWindow.Design.Common;
using System.ComponentModel;
using DraggableWindow;

namespace DraggableWindow.Design
{
    /// <summary>
    /// To register design time metadata for WrapPanel.
    /// </summary>
    internal class PopupWindowMetadata : AttributeTableBuilder
    {
        /// <summary>
        /// To register design time metadata for WrapPanel.
        /// </summary>
        public PopupWindowMetadata()
            : base()
        {
            AddCallback(
               typeof(DragDropControl ),
               b =>
               {
                   b.AddCustomAttributes(Extensions.GetMemberName<DragDropControl>(x => x.CanResize ),
                       new CategoryAttribute(Properties.Resources.LayoutProperties));
                   b.AddCustomAttributes(Extensions.GetMemberName<DragDropControl>(x => x.OffsetX),
                       new CategoryAttribute(Properties.Resources.LayoutProperties));
                   b.AddCustomAttributes(Extensions.GetMemberName<DragDropControl>(x => x.OffsetY),
                       new CategoryAttribute(Properties.Resources.LayoutProperties));
                   b.AddCustomAttributes(Extensions.GetMemberName<DragDropControl>(x => x.OffsetX),
                        new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
                   b.AddCustomAttributes(Extensions.GetMemberName<DragDropControl>(x => x.OffsetY),
                        new EditorBrowsableAttribute(EditorBrowsableState.Advanced));

               });
            AddCallback(
                typeof(PopupWindow),
                b =>
                {

                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.Visibility ),
                           new EditorBrowsableAttribute(EditorBrowsableState.Never));
                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.Visibility),
                           new BrowsableAttribute(false));

                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.Title),
                        new CategoryAttribute(Properties.Resources.CommonProperties));
                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.Status),
                        new CategoryAttribute(Properties.Resources.CommonProperties));

                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.StatusVisibility ),
                        new CategoryAttribute(Properties.Resources.AppearanceProperties));

                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.StatusTemplate),
                        new EditorBrowsableAttribute(EditorBrowsableState.Advanced));

                    b.AddCustomAttributes(Extensions.GetMemberName<PopupWindow>(x => x.TitleTemplate),
                           new EditorBrowsableAttribute(EditorBrowsableState.Advanced));
                });

        
        }
    }
}
